package experiment.e09.code;

/**
 * @author thinkpad - 83start
 * @version v1.0
 * @create 2022/12/1 14:12
 * @package experiment.e09.code
 * @description 文件说明
 */

public class E01 {
    public static void main(String[] args) {
        TestThread1 testThread1 = new TestThread1();
        testThread1.start();

        TestRunner1 testRunner1 = new TestRunner1();
        Thread thread = new Thread(testRunner1);
        thread.start();
    }
}

class TestThread1 extends Thread {
    int count = 0;

    @Override
    public void run() {
        for (int i = 101; i < 500; i++) {
            if (i % 2 == 0) {
                count += i;
            }
        }
        System.out.println(count);
    }
}

class TestRunner1 implements Runnable {
    int count = 0;
    @Override
    public void run() {
        for (int i = 101; i < 500; i++) {
            if (i % 2 != 0) {
                count += i;
            }
        }
        System.out.println(count);
    }
}